﻿using Prism.Commands;
using Prism.Mvvm;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WPFPrism.Common.Models;

namespace WPFPrism.ViewModels
{
    public class IndexViewModel : BindableBase
    {
        public IndexViewModel()
        {

            CreatTaskBars();


            CreatMemoDtos();


            CreatToDoDtos();
        }
        private ObservableCollection<TaskBar> taskBars;

        public ObservableCollection<TaskBar> TaskBars
        {
            get { return taskBars; }
            set { taskBars = value; RaisePropertyChanged(); }
        }

        private ObservableCollection<ToDoDto> toDoDtos;

        public ObservableCollection<ToDoDto> ToDoDtos
        {
            get { return toDoDtos; }
            set { toDoDtos = value; RaisePropertyChanged(); }
        }

        private ObservableCollection<MemoDto> memoDtos;

        public ObservableCollection<MemoDto> MemoDtos
        {
            get { return memoDtos; }
            set { memoDtos = value; RaisePropertyChanged(); }
        }
        void CreatTaskBars()
        {
            TaskBars = new ObservableCollection<TaskBar>();
            TaskBars.Add(new TaskBar() { Icon = "ClockFast", Title = "汇总", Content = "9", Color = "#FF0CA0FF", Target = "" });
            TaskBars.Add(new TaskBar() { Icon = "ClockCheckOutline", Title = "已完成", Content = "9", Color = "#FF1ECA3A", Target = "" });
            TaskBars.Add(new TaskBar() { Icon = "ChartLineVariant", Title = "完成比例", Content = "57", Color = "#FF02C6DC", Target = "" });
            TaskBars.Add(new TaskBar() { Icon = "PlaylistStar", Title = "备忘录", Content = "100", Color = "#FFFFA000", Target = "" });
        }

        void CreatToDoDtos()
        {
            ToDoDtos = new ObservableCollection<ToDoDto>();
            for (int i = 10; i < 50; i++)
            {
                ToDoDtos.Add(new ToDoDto() { Content = "123"+i, Title = "123" });
            }
        }

        void CreatMemoDtos()
        {
            MemoDtos = new ObservableCollection<MemoDto>();
            for (int i = 10; i < 50; i++)
            {
                MemoDtos.Add(new MemoDto() { Title = "45646"+i, Content = "45646" });
            }
        }
    }
}
